#include<cstdio>
#include<cstring>
const int maxn=1100;
int p[maxn],f[maxn],count=1,n;
bool prim[maxn];
int main()
{
	memset(prim,1,sizeof(prim));
    p[1]=1;f[1]=1;
	for(int i=2;i<=maxn;i++)
		if(prim[i])
		{
			p[++count]=i;
			for(int j=i+i;j<=maxn;j+=i)
				prim[j]=0;
		}
	for(int i=2;i<=maxn;i++)
		if(prim[i])f[i]=f[i-1]+1;
	    else f[i]=f[i-1];
	int n,c;
	while(scanf("%d%d",&n,&c)!=EOF)
	{
		int t=f[n];
		int l,r;
		if(t%2==0)
		{
			l=t/2-c+1;
			r=t/2+c;
		}
		else
		{
			l=t/2+1-c+1;
			r=t/2+c;
		}
		if(l<=0)
		{
			l=1;
			r=t;
		}
		printf("%d %d:",n,c);
		for(int i=l;i<=r;i++)
			printf(" %d",p[i]);
		printf("\n\n");
	}
	return 0;
}





